<?php 
	$link = mysqli_connect('localhost','root','');
		if( mysqli_connect_errno($link) ){
			die( mysqli_connect_error($link) );
		}
	mysqli_select_db($link,'test');
	mysqli_set_charset($link, 'utf8');


	$sql = 'select * from user';
	$result = mysqli_query($link, $sql);
	    
	$list = array();
	if(mysqli_affected_rows($link) > 0){
		while( $row =  mysqli_fetch_assoc($result) ){
			$list[] = $row;
		}
	}
	var_dump($list);
	mysqli_close($link);

 ?>